package com.justnow.offer;

import java.beans.BeanInfo;
import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author justnow
 * Created on 2020-09-12
 * Description
 */
public class Hwl02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] a = s.toCharArray();
        BigInteger sum = new BigInteger("0");
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 'i') {
                sum = sum.add(helper(a.length - i - 1));
            }
        }
        BigInteger cnt = new BigInteger("1");
        int k = 0;
        while (cnt.compareTo(sum) == -1) {
            k++;
            cnt = help(k);
        }
        System.out.println(k);
    }

    private static BigInteger helper(int n) {
        if (n == 0) {
            return new BigInteger("1");
        }
        BigInteger a = new BigInteger("2");
        return a.multiply(helper(n - 1));
    }

    public static BigInteger help(int n) {
        if (n == 0) {
            return new BigInteger("1");
        }
        BigInteger a = new BigInteger("4");
        return a.multiply(help(n - 1));
    }
}
